<template>
	<view class="content">
		<!-- 发现页面 -->
		<view class="search">
			<u-icon name="level" class="left"></u-icon>
			<u-search class="center" placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false"></u-search>
			<u-icon name="apple-fill" class="right"></u-icon>
		</view>
		<view class="swiper">
			<u-swiper :list="list" name="imageUrl"></u-swiper>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// banner list
				list: [],
				// 搜索关键词
				keyword: ''
			}
		},
		onLoad() {

		},
		mounted() {
			this.getdata()
		},
		methods: {
			getdata() {
				this.$axios.get('/banner').then(res => {
					this.list = res.data.banners
					// console.log('banner', this.list)
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		margin: 10rpx;

		.search {
			height: 100rpx;
			display: flex;
			width: 100%;
			align-items: center;

			.left,
			.right {
				flex: 1;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			.center {
				flex: 8;
			}
		}

		.swiper {
			margin: 10rpx;
		}
	}
</style>
